# -*- coding: utf-8 -*-

"""
@author: Laowang
@contact: QQ:1125564921
@Created on: 2022/6/23
@Remark: 
"""
import os
from logging import CRITICAL
from typing import Dict, Any
from tzlocal import get_localzone

# ENV
# test, dev, pro
FRAMEWORK_STRATEGY = "test"

# MYSQL
MYSQL_HOST = "127.0.0.1"
MYSQL_PORT = "3306"
MYSQL_USER = "root"
MYSQL_PASS = "123456"
MYSQL_DB = "strategy"

# MIDDLEWARE
# Execute from top to bottom
REQUEST_RESPONSE_MIDDLEWARE = [
    # "framework_strategy.gopy.middleware.templatemiddleware.TemplateMiddleware",
    # "framework_strategy.gopy.middleware.templatemiddleware.RecordsMiddleware",
]

# REDIS
REDIS_HOST = "127.0.0.1"
REDIS_PORT = "7006"
REDIS_PASSWORD = ""
REDIS_DB = 0

# LOG | EMAIL
SETTINGS: Dict[str, Any] = {
    "font.family": "微软雅黑",
    "font.size": 12,

    "log.active": True,
    "log.level": CRITICAL,
    "log.console": True,
    "log.file": True,
    "log.path": os.path.dirname(os.path.dirname(__file__)),

    "email.server": "smtp.qq.com",
    "email.port": 465,
    "email.username": "1125564921@qq.com",
    "email.password": "polwpjkacchrggcc",
    "email.sender": "1125564921@qq.com",
    "email.receiver": "f1125564921@163.com",
}

# RPC
RPC_PORT = 9898
RPC_HOST = "0.0.0.0"
# RPC_HOST = "127.0.0.1"
PRC_MAX_WORK = 300

# ZMQ
ZMQ_PORT = "5555"
ZMQ_HOST = "*"
